var formatter = new Intl.NumberFormat('pt-BR', {
  style: 'currency',
  currency: 'BRL',
  minimumFractionDigits: 2,
  });


document.getElementById("precisamos").innerHTML = formatter.format(total - temos);
document.getElementById("temos").innerHTML = formatter.format(temos);

document.getElementById('barra').setAttribute('style', 'width:' + ((100*temos)/(total) + 1) + '%');


function centerPopup(url, title, w, h)
{
  var topo = ((screen.height/2) - (h/2));
  var esquerda = ((screen.width/2) - (w/2));

  return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+topo+', left='+esquerda);
}
